function [ oi ] = eval_pattern( weights, pattern )

global LAYERS;
%EVAL_PATTERNS Summary of this function goes here
%   Detailed explanation goes here

h = cell(1,length(LAYERS));
input = pattern;

for i = 1:length(LAYERS)
    hi = weights{i} * input;
    h{i} = hi;
    input = vertcat(-1, g_function(hi));
end

oi = input(2,:);

end

